# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=circuslinux
pkgver=1.0.3
pkgrel=1
pkgdesc="Clone of the Atari 2600 game Circus Atari"
url="http://www.newbreedsoftware.com/circus-linux/"
arch="all"
license="GPL-2.0-or-later"
depends="$pkgname-data libmikmod"
makedepends="bash automake autoconf sdl12-compat-dev sdl_image-dev sdl_mixer-dev"
subpackages="$pkgname-data::noarch $pkgname-doc"
source="https://github.com/antonialoytorrens/nbs/raw/master/unix/x/circus-linux/src/circuslinux-$pkgver.tar.gz
	circuslinux.desktop
	circuslinux-icon.xpm
	"

prepare() {
	default_prepare
	update_config_sub
	update_config_guess
	autoreconf -fvi
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--datadir=/usr/share/circuslinux
	make
}

check() {
	make check
}

package() {
	make install \
		datadir="$pkgdir"/usr/share/circuslinux \
		prefix="$pkgdir"/usr
	install -Dm644 "$srcdir"/circuslinux.desktop \
	"$pkgdir"/usr/share/applications/circuslinux.desktop
	install -Dm644 "$srcdir"/circuslinux-icon.xpm \
	"$pkgdir"/usr/share/pixmaps/circuslinux-icon.xpm
}

data() {
	pkgdesc="$pkgdesc (data files)"
	amove /usr/share/circuslinux
}

sha512sums="2a5b85c50fcc2363858ba5515c17e9733699b4139e10d9b047aeb4b3c6fc6c75f75f1ea24e8f0e6fc5b6a7d78af8ab6f44f0c572f81271d3a4a6c49548fa139a  circuslinux-1.0.3.tar.gz
087ba7a781dbcfc17e6f4976ba3c4e4381fcd3618b3c4998b2cfc1a4c96aed7883c222d81eaa72c605cf68a138db088e8cdf3441e7e849ffdfa5d82d2e95319c  circuslinux.desktop
15914ac850aecf92ff09f907123356caf77fcdd6c24e76acdd7575279591beb785676aa8452ccc302314d1d04a8320cc10b39942b629197bb6134dea0e9c413c  circuslinux-icon.xpm"
